Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planner: fix cannot binding for deleting multi table with alias #57255

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Nov 8, 2024

What problem does this PR solve?

Issue Number: close #56726

Problem Summary:

What changed and how does it work?

delete tt1 from t1 tt1,(select max(id) id from t2)tt2 where tt1.id<=tt2.id
delete tt1 will be transfer to delete current_database.t1 in default when to deal with the statsment in the create binding.
because tt1 cannot be used as alias in delete statement.
so we have to set tt1 as alias by aliasChecker.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

fix cannot binding for deleting multi table with alias

修复无法为带别名的多表删除进行 binding 的问题

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-tests-checked do-not-merge/needs-triage-completed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/planner SIG: Planner labels Nov 8, 2024
@hawkingrei hawkingrei marked this pull request as draft November 12, 2024 08:01
@ti-chi-bot ti-chi-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 12, 2024
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 15, 2024
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 15, 2024
@hawkingrei hawkingrei marked this pull request as ready for review November 15, 2024 05:14
@ti-chi-bot ti-chi-bot bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-triage-completed do-not-merge/needs-tests-checked labels Nov 15, 2024
@hawkingrei hawkingrei changed the title planner: fix cannot binding for deleting multi table planner: fix cannot binding for deleting multi table with alias Nov 15, 2024
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 15, 2024
@hawkingrei hawkingrei requested a review from qw4990 November 15, 2024 05:30
@hawkingrei
Copy link
Member Author

/retest

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

Attention: Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.

Project coverage is 73.4985%. Comparing base (3c70a28) to head (efe464f).
Report is 3 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57255        +/-   ##
================================================
+ Coverage   72.8888%   73.4985%   +0.6096%     
================================================
  Files          1672       1672                
  Lines        462231     462307        +76     
================================================
+ Hits         336915     339789      +2874     
+ Misses       104562     101842      -2720     
+ Partials      20754      20676        -78     
Flag Coverage Δ
integration 43.4020% <75.0000%> (?)
unit 72.3046% <94.5945%> (+0.0382%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.7673% <ø> (ø)
parser ∅ <ø> (∅)
br 45.1379% <ø> (-0.0031%) ⬇️

Copy link

ti-chi-bot bot commented Nov 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qw4990, tangenta

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 15, 2024
Copy link

ti-chi-bot bot commented Nov 15, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-15 07:42:35.820544997 +0000 UTC m=+601318.011413987: ☑️ agreed by tangenta.
  • 2024-11-15 08:50:09.145173889 +0000 UTC m=+605371.336042881: ☑️ agreed by qw4990.

@ti-chi-bot ti-chi-bot bot merged commit 4fded5f into pingcap:master Nov 15, 2024
23 checks passed
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. labels Nov 15, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #57419.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #57420.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Nov 15, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #57421.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #57422.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Nov 15, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #57423.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Nov 15, 2024
hawkingrei added a commit to ti-chi-bot/tidb that referenced this pull request Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ERROR 1109 when create global binding for delete statement with subquery
4 participants